//
//  main.m
//  成员变量访问
//
//  Created by mir_yan on 2018/9/24.
//  Copyright © 2018年 hakeem. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "Person.h"

// 结构体
struct Student {
    char* name;
    int* age;
};

int main(int argc, const char * argv[]) {
    @autoreleasepool {
//        struct Student s1 = {"dang", 20};
//        NSLog(@"name:%s age:%d", s1.name, s1.age);
//        
//        struct Student* ps1 = (strcat Student*)malloc(sizeof(struct Student));
//        ps1->name ="maray";
//        ps1->age = 22;
        
        // 成员变量收保护
        Person* xiaoMing = [[Person alloc] init];
        [xiaoMing setAge:(19)];
        int xAge = [xiaoMing age];
        NSLog(@"age:%d", xAge);
//        xiaoMing->_name;
        
        NSLog(@"Hello, World!");
    }
    return 0;
}
